﻿using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OPCCollect
{
    public class TagInfo
    {
        public TagInfo()
        {
            DevId = 0;
            DevName = string.Empty;
            Coefficient = 1d;
            OpcName = string.Empty;
            OpcType = string.Empty;
            OpcValue = null;
        }

        /// <summary>
        /// PinusDB 设备ID
        /// </summary>
        public long DevId { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string DevName { get; set; }

        /// <summary>
        /// 转换系数 OPC采集值 * 系数 => PinusDB值
        /// 仅在类型为real时有效
        /// </summary>
        public double Coefficient { get; set; }

        /// <summary>
        /// OPC名字
        /// </summary>
        public string OpcName { get; set; }

        /// <summary>
        /// OPC数据类型
        /// bool boolean类型，true -> 1, false -> 0
        /// real 浮点数，opc采集值 * Coefficient 后取整存储到PinusDB
        /// int  整数，直接存储到PinusDB
        /// </summary>
        public string OpcType { get; set; }


        public DataValue OpcValue { get; set; }
    }
}
